<template>
    <div class='opt _page-content'>
      <div>
        姓名：<input type="text" name="" v-model="inputValue" id="">
      </div>
      <button @click="$router.back()">取消</button>
      <button @click="submit">完成</button>
      <button @click="submitToSetting">完成并跳转至设置页面</button>
    </div>
</template>

<script>
export default {
    name:'',
    components:{},
    props:{},
    data() {
        return{
          inputValue:0
        }
    },
    created() {
      console.log('opt - created');
    },
    destroyed(){
      console.log(123123);
    },
    activated() {
      this.$eventChannel.on('hahah',()=>{
        console.log('哈哈哈');
      })
      this.inputValue = this.$dataStorage.getData('getName')
    },
    beforeDestroy() {},
    methods: {
      submit(){
        this.$eventChannel.emit('setName',this.inputValue)
        this.$router.back()
      },
      submitToSetting(){
        this.$eventChannel.emit('setName',this.inputValue)
        this.$router.replace('/setting')
      }
    },
}
</script>

<style lang="scss" scoped>
</style>